# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DocumentAI.V1.Model.GoogleCloudDocumentaiV1EvaluationMetrics do
  @moduledoc """
  Evaluation metrics, either in aggregate or about a specific entity.

  ## Attributes

  *   `f1Score` (*type:* `number()`, *default:* `nil`) - The calculated f1 score.
  *   `falseNegativesCount` (*type:* `integer()`, *default:* `nil`) - The amount of false negatives.
  *   `falsePositivesCount` (*type:* `integer()`, *default:* `nil`) - The amount of false positives.
  *   `groundTruthDocumentCount` (*type:* `integer()`, *default:* `nil`) - The amount of documents with a ground truth occurrence.
  *   `groundTruthOccurrencesCount` (*type:* `integer()`, *default:* `nil`) - The amount of occurrences in ground truth documents.
  *   `precision` (*type:* `number()`, *default:* `nil`) - The calculated precision.
  *   `predictedDocumentCount` (*type:* `integer()`, *default:* `nil`) - The amount of documents with a predicted occurrence.
  *   `predictedOccurrencesCount` (*type:* `integer()`, *default:* `nil`) - The amount of occurrences in predicted documents.
  *   `recall` (*type:* `number()`, *default:* `nil`) - The calculated recall.
  *   `totalDocumentsCount` (*type:* `integer()`, *default:* `nil`) - The amount of documents that had an occurrence of this label.
  *   `truePositivesCount` (*type:* `integer()`, *default:* `nil`) - The amount of true positives.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :f1Score => number() | nil,
          :falseNegativesCount => integer() | nil,
          :falsePositivesCount => integer() | nil,
          :groundTruthDocumentCount => integer() | nil,
          :groundTruthOccurrencesCount => integer() | nil,
          :precision => number() | nil,
          :predictedDocumentCount => integer() | nil,
          :predictedOccurrencesCount => integer() | nil,
          :recall => number() | nil,
          :totalDocumentsCount => integer() | nil,
          :truePositivesCount => integer() | nil
        }

  field(:f1Score)
  field(:falseNegativesCount)
  field(:falsePositivesCount)
  field(:groundTruthDocumentCount)
  field(:groundTruthOccurrencesCount)
  field(:precision)
  field(:predictedDocumentCount)
  field(:predictedOccurrencesCount)
  field(:recall)
  field(:totalDocumentsCount)
  field(:truePositivesCount)
end

defimpl Poison.Decoder,
  for: GoogleApi.DocumentAI.V1.Model.GoogleCloudDocumentaiV1EvaluationMetrics do
  def decode(value, options) do
    GoogleApi.DocumentAI.V1.Model.GoogleCloudDocumentaiV1EvaluationMetrics.decode(value, options)
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.DocumentAI.V1.Model.GoogleCloudDocumentaiV1EvaluationMetrics do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
